import i18n from '@/locales'
import { has } from 'lodash-es'
import competition from './custom/competition'
import defaultTip from './defaultTip'

/**
 * 默认使用 默认提示
 * VITE_TIPS_TYPE course 课程提示 competition 竞赛提示 可扩展
 */

const lang = i18n.global.locale.value as 'zh' | 'en'
const tipsPool: Record<string, string[]> = {
  competition: competition[lang],
}
const tipType: string = import.meta.env.VITE_TIP_TYPE
  ? (import.meta.env.VITE_TIP_TYPE as string)
  : 'ghost'

export const useTips = () => {
  return has(tipsPool, tipType)
    ? [...defaultTip[lang], ...tipsPool[tipType]]
    : [...defaultTip[lang]]
}
